const http = uni.$u.http

// post请求，获取菜单
// export const postMenu = (params, config = {}) => http.post('/ebapi/public_api/index', params, config)

// get请求，批量获取广告列表，注意：get请求的配置等，都在第二个参数中，详见前面解释


//获取登录的用户信息
export const getLoginUserInfo = () => http.get('/api/webapp/login/user/getInfo')
// 手机号登录
export const phoneLogin = (phoneNumber) => http.post('/api/webapp/login/phone', {
    phoneNumber
})

//根据用户编号获取详细信息
export const getUserInfo = (params) => http.get(`/api/webapp/system/user/${params}`)
//根据用户编号修改用户信息
export const updateUserInfo = (params) => http.put(`/api/webapp/system/user`, params , {
    header: {
        "Content-Type":"application/json"
    }
})

// 查询首页轮播图列表
export const getBannerList = (params) => http.get('/api/webapp/house/banner/list', {
    params
})

//获取当前城市
export const getLocationCity = () => http.get('/api/webapp/house/baiduMap/getCity')


//查询房源出租信息（大部分数据来自安居客）列表
export const getHouseInfoList = (params) => http.get('/api/webapp/house/info/list', {
    params
})
//获取房源出租信息（大部分数据来自安居客）详细信息
export const getHouseInfo = (params) => http.get(`/api/webapp/house/info/${params}`)
//新增房源出租信息（大部分数据来自安居客）
export const addHouseInfo = (params) => http.post(`/api/webapp/house/info`, params , {
    header: {
        "Content-Type":"application/json"
    }
})


//查询我的收藏列表
export const getMyFavoriteList = (params) => http.get(`/api/webapp/house/favorite/list`, {
    params
})
//新增我的收藏
export const addMyFavorite = (params) => http.post('/api/webapp/house/favorite', params , {
    header: {
        "Content-Type":"application/json"
    }
})
//删除我的收藏
export const deleteMyFavorite = (params) => http.delete(`/api/webapp/house/favorite/${params.join(",")}`)
//通过用户id 和 房源id 删除我的收藏
export const deleteMyFavoriteByUserIdAndHouseZuInfoId = (params) => http.delete(`/api/webapp/house/favorite/${params.userId}/${params.houseZuInfoId}`)

//获取通知公告列表
export const getSystemNoticeList = (params) => http.get(`/api/webapp/system/notice/list`, {
    params
})
//根据通知公告编号获取详细信息
export const getSystemNoticeInfo = (params) => http.get(`/api/webapp/system/notice/${params}`)
